<template>
  <div class="app-container">
    <!-- 搜索 -->
    <el-card class="search-card">
      <el-form size="small" :model="queryParams" class="formBox" label-width="88px">
        <el-row :gutter="0">
          <el-col :span="5">
            <el-form-item label="关键词" prop="gradeId">
              <el-input
                placeholder="请输入关键词"
                v-model="queryParams.status"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="19">
            <el-form-item>
              <div class="dis aic">
                <div class="flex_1"></div>
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  size="mini"
                  @click="handleQuery"
                >
                  搜索
                </el-button>
                <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">
                  重置
                </el-button>
              </div>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-card>
    <el-card class="search-card">
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="buttonMethods(1)"
            v-hasPermi="['campus:unpaid:export']"
          >
            添加
          </el-button>
        </el-col>
        <right-toolbar
          :showSearch.sync="showSearch"
          @queryTable="getList"
        ></right-toolbar>
      </el-row>
    </el-card>
    <el-card class="table-card">
      <el-table :data="dataList">
        <el-table-column label="通知标题" align="center" prop="name" />
        <el-table-column label="是否启用" align="center" prop="idCardNumber" />
        <el-table-column label="创建时间" align="center" prop="idCardNumber" />
        <el-table-column label="创建人" align="center" prop="idCardNumber" />
        <el-table-column label="修改人" align="center" prop="idCardNumber" />
        <el-table-column label="修改时间" align="center" prop="idCardNumber" />
        <el-table-column label="操作" align="center" prop="idCardNumber" />
      </el-table>
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </el-card>
    <el-dialog :title="title" :visible.sync="open" width="40%" append-to-body>
      <el-form ref="form" :model="queryForm" label-width="95px">
        <el-row>
          <el-col :span="22">
            <el-form-item label="通知标题" prop="gradeId" style="width: 100%">
              <el-input
                v-model="queryParams.gradeId"
                placeholder="请选择通知标题"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="22">
            <el-form-item label="是否启用" prop="gradeName">
              <el-radio-group v-model="queryForm.radio">
                <el-radio :label="1">启用</el-radio>
                <el-radio :label="2">关闭</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="22">
            <el-form-item label="内容描述" prop="gradeId" style="width: 100%">
              <editor
                v-model="queryParams.noticeContent"
                :min-height="220"
                style="height: 100% !important"
              />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="buttonMethods(2)">确 定</el-button>
        <el-button @click="buttonMethods(3)">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listGrade } from "@/api/campus/grade";
import { listClassManage } from "@/api/campus/classManage";

export default {
  name: "Person",
  data() {
    return {
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 1,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      dataList: [
        {
          status: 1,
          name: "1",
        },
        {
          name: "2",
          status: 2,
        },
      ],
      campusList: [],
      gradeList: [],
      queryForm: {},
    };
  },
  created() {},
  activated() {},
  methods: {
    // 列表
    getList() {},
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    buttonMethods(options, value) {
      if (options == 1) {
        this.open = true;
        this.title = "添加通知";
      }
    },
    // 导出
    handleExport() {
      this.download(
        "",
        {
          ...this.queryParams,
        },
        `餐别管理导出.xlsx`
      );
    },
  },
};
</script>
<style>
.padding_4_10 {
  padding: 4px 10px !important;
}
</style>
